package cn.bitkit.assist.jdbc;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author changbo
 */
@Getter
@Setter
public class CallValue {
	
	private int index;
    private Map<Integer, Object> inMap;
    private Map<Integer, Integer> outTypeMap;
    private Map<Integer, Object> outMap;

    public static CallValue init() {
    	CallValue p = new CallValue();
    	p.setInMap(new HashMap<>(1));
    	p.setOutTypeMap(new HashMap<>(1));
        p.setIndex(0);
    	return p;
    }

    public CallValue in(Object param) {
        inMap.put(++index, param);
        return this;
    }

    public CallValue outType(int outType) {
        outTypeMap.put(++index, outType);
        return this;
    }

    public CallValue out(int index, Object param) {
        outMap.put(index, param);
        return this;
    }

}
